#!/usr/bin/env node

const events= require('events'),
      util= require('util');

function Radio(station) {
  events.call(this);

  var self = this;//保存指针

  setTimeout(() => {
    self.emit('open', station);
  }, 0);

  setTimeout(() => {
    self.emit('stop', station);          
  }, 5000);

}
//实现Readio类的继承,第一个参数是自己的类，后面是被继承的类
util.inherits(Radio, events.EventEmitter);

module.exports = Radio;

